<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //(1)手动创建   Error
        throw new Error("描述信息")
        //Uncaught Error: 描述信息


        // (2)语法错误  SyntaxError
        // console.log ('hello';
        // Uncaught SyntaxError: missing ) after argument list
    
        //(3)引用错误   ReferenceError
        // test 未定义，也就是未分配栈地址
        // Uncaught ReferenceError: test is not defined
        // var t = test;

        //(4)类型错误   TypeError
        // 类型调用错误
        // Uncaught TypeError: Object.test is not a function
        // test 未定义，应该是undefined，这里作为函数调用
        // Object.test()

        //(5)范围错误   RangeError
        // Uncaught RangeError: Invalid array length
        // new Array(-1)

        // try{...} catch{...}
        // 执行try语句,有报错跳转到catch语句
    </script>
</body>
</html>